From: Jan Beulich Date: Tue, 6 Apr 2021 14:18:41 +0000 (+0200) Subject: rangeset: no need to use snprintf() X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~760 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6425fcf37122b1f1e4ceaacadd00a4c280a58f57;p=xen.git rangeset: no need to use snprintf() As of the conversion to safe_strcpy() years ago there has been no need anymore to use snprintf() to prevent storing a not-nul-terminated string. Signed-off-by: Jan Beulich Acked-by: Julien Grall --- diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c index 4ebba30ba3..0afe638f40 100644 --- a/xen/common/rangeset.c +++ b/xen/common/rangeset.c @@ -436,14 +436,7 @@ struct rangeset *rangeset_new( BUG_ON(flags & ~RANGESETF_prettyprint_hex); r->flags = flags; - if ( name != NULL ) - { - safe_strcpy(r->name, name); - } - else - { - snprintf(r->name, sizeof(r->name), "(no name)"); - } + safe_strcpy(r->name, name ?: "(no name)"); if ( (r->domain = d) != NULL ) {